import router from '../router/index'

import axios from './axios';
const domain='https://bibiji.rzkeji.com/api/';
axios.defaults.baseURL = domain;
axios.interceptors.response.use(function (response) {
  // 重定向到登录页面
  if (response.data.data == 'no_login'){
    window.localStorage.removeItem('user_name');
    router.replace({ path: '/login'})
  }else{
    return response;
  }
})
//获取验证码
export const getCode = (params) => axios.post('https://bibiji.rzkeji.com/api/auth/sendVerificationCode', params);
//获取管理员用户信息
export const getAdminUserInfo = (params) => axios.get('getAdminUserInfo', {'params':{...params}});
//登陆
export const companyPublicizeLogin = (params) => axios.post('companyPublicizeLogin',params);
//管理员登录
export const adminSignIn = (params) => axios.post('admin/auth/admin-sign-in',params);
//获取用户信息
export const getUserInfo = (params) => axios.get('https://bibiji.rzkeji.com/api/ucenter/getUserInfo', {'params':{...params}});
//用户退出
export const loginOut = () => axios.get('admin/auth/signOut');


//用户管理
//获取用户列表
export const getUserList = (params) => axios.get('admin/sys/getUserList', {'params':{...params}});


//圈子
//获取圈子列表
export const getCircleList = (params) => axios.get('admin/sys/getCircleList', {'params':{...params}});
//获取圈子详情
export const getCircleDetail = (params) => axios.get('admin/sys/getCircleDetail', {'params':{...params}});

//新建一个圈子的分类
export const adminAddCircleClassify = (params) => axios.post('admin/sys/adminAddCircleClassify',params);
//删除圈子
export const delCircle = (params) => axios.post('admin/sys/delCircle',params);
//删除帖子分类
export const delArticleType = (params) => axios.post('admin/sys/delArticleType',params);
//新建一个圈子
export const adminAddCircle = (params) => axios.post('admin/sys/adminAddCircle',params);
//删除圈子里面的分类（表白墙）
export const delCircleSupportClassify = (params) => axios.post('admin/sys/delCircleSupportClassify',params);

//删除圈子分类
export const delCircleClassify = (params) => axios.post('admin/sys/delCircleClassify',params);


//获取系统已录入的圈子类型
export const getCircleClassifyList = (params) => axios.get('admin/sys/getCircleClassifyList', {'params':{...params}});

//获取圈子管理员
export const getCircleAdminList = (params) => axios.get('admin/getCircleAdminList', {'params':{...params}});

//设置圈子管理员
export const setCircleAdmin = (params) => axios.post('admin/setCircleAdmin',params);
//获取圈子申请列表
export const getCircleApplicationList = (params) => axios.get('admin/sys/getCircleApplicationList',{'params':{...params}});
//拒绝圈子申请
export const denyCircleApplication = (params) => axios.post('admin/sys/denyCircleApplication',params);
//批准圈子申请
export const passCircleApplication = (params) => axios.post('admin/sys/passCircleApplication',params);
//设置圈子推荐
export const setCircleRecommend = (params) => axios.post('admin/sys/setCircleRecommend',params);
//设置帖子推荐
export const setArticleRecommend = (params) => axios.post('admin/sys/setArticleRecommend',params);



//帖子
  //获取帖子列表
  export const getArticleList = (params) => axios.get('admin/sys/getArticleList', {'params':{...params}});
  //添加(表白墙之类的)帖子分类
  export const adminAddArticleClassify = (params) => axios.post('admin/sys/adminAddArticleClassify',params);
  //获取已录入的帖子分类（表白墙，失物招领）
  export const getArticleClassifyList = (params) => axios.get('admin/sys/getArticleClassifyList', {'params':{...params}});
  //设置圈子支持的帖子类型（表白墙、失物招领）
  export const adminSetCircleSupportClassify = (params) => axios.post('admin/sys/adminSetCircleSupportClassify',params);
  //删除帖子
  export const delArticle = (params) => axios.post('admin/sys/delArticle',params);
  //置顶
  export const setArticleOnTop = (params) => axios.post('admin/sys/setArticleOnTop',params);
  //取消置顶
  export const unSetArticleOnTop = (params) => axios.post('admin/sys/unSetArticleOnTop',params);
  //获取帖子详情
  export const getArticleDetail = (params) => axios.get('article/getArticleDetail', {'params':{...params}});
  //运营号发布帖子
  export const releasePostArticle = (params) => axios.post('admin/releasePostArticle',params);
  //获取评论列表
  export const getCommentList = (params) => axios.get('admin/sys/getCommentList', {'params':{...params}});
  //删除评论
  export const delComment = (params) => axios.post('admin/sys/delComment',params);
  //通过用户发表的帖子
  export const passArticle = (params) => axios.post('admin/sys/passArticle',params);
  //不通过用户发表的帖子
  export const denyArticle = (params) => axios.post('admin/sys/denyArticle',params);








//运营
  //获取运营账号列表
  export const getOperationNumList = (params) => axios.get('admin/getOperationNumList', {'params':{...params}});
  //添加运营账号
  export const setOperationNum = (params) => axios.post('admin/setOperationNum',params);
  //删除运营账号
  export const delOperationNum = (params) => axios.post('admin/delOperationNum',params);
//获取运营账号详情
  export const getOperateAcount = (params) => axios.get('admin/sys/getOperateAcount',{'params':{...params}});



  //积分兑换
  export const setGoods = (params) => axios.post('admin/setGoods',params);
  //获取商品列表
  export const getGoodsList = (params) => axios.get('admin/getGoodsList', {'params':{...params}});
  //获取商品详情
  export const getGoodsDetail = (params) => axios.get('admin/getGoodsDetail', {'params':{...params}});
  //删除商品
  export const delGoods = (params) => axios.post('admin/delGoods',params);
  //获取商品banner列表
  export const goodsBannerList = (params) => axios.get('admin/goodsBannerList', {'params':{...params}});
  //获取商品banner详情
  export const goodsBannerDetail = (params) => axios.get('admin/goodsBannerDetail', {'params':{...params}});
  //设置商品banner
  export const setGoodsBanner = (params) => axios.post('admin/setGoodsBanner',params);
  //删除商品banner
  export const delGoodsBanner = (params) => axios.post('admin/delGoodsBanner',params);



  //积分兑换列表
  export const ordersList = (params) => axios.get('admin/ordersList', {'params':{...params}});
  //改变发货状态
  export const changeOrderStatus = (params) => axios.post('admin/changeOrderStatus',params);
  //积分兑换详情
  export const ordersDetails = (params) => axios.get('admin/ordersDetails', {'params':{...params}});
  //获取发货地址信息
  export const getWriteShipInfo = (params) => axios.get('admin/getWriteShipInfo', {'params':{...params}});
  //设置发货地址信息
  export const setShipInfo = (params) => axios.post('admin/setShipInfo',params);
  //获取快递公司列表
  export const getExpressList = (params) => axios.get('admin/getExpressList', {'params':{...params}});













//消息
  //系统消息
  //设置系统通知
  export const setSysNews = (params) => axios.post('admin/sys/setSysNews', params);
  //获取系统通知列表
  export const getSysNewsList = (params) => axios.get('admin/sys/getSysNewsList', {'params':{...params}});
  //获取系统通知详情
  export const getSysNewsDetail = (params) => axios.get('admin/sys/getSysNewsDetail', {'params':{...params}});
  //删除系统通知
  export const delSysNews = (params) => axios.post('admin/sys/delSysNews', params);


  //举报
  //获取用户举报信息
  export const getUserReport = (params) => axios.get('admin/sys/getUserReport', {'params':{...params}});




//系统管理
  //轮播图
  export const getBannerList = (params) => axios.get('admin/sys/getBannerList', {'params':{...params}});
  //编辑轮播图
  export const bannerSet = (params) => axios.get('admin/sys/bannerSet', {'params':{...params}});
  //新增轮播图
  export const setBanner = (params) => axios.post('admin/sys/setBanner', params);
  //删除banner
  export const delBanner = (params) => axios.post('admin/sys/delBanner', params);
  //获取圈子详情
  export const getBannerDetail = (params) => axios.get('admin/sys/getBannerDetail', {'params':{...params}});


  //获取管理员列表
  export const getAdminList = (params) => axios.get('admin/auth/adminList', {'params':{...params}});
  //编辑管理员
  export const adminSet = (params) => axios.get('admin/auth/adminSet', {'params':{...params}});
  //添加管理员
  export const setAdmin = (params) => axios.post('admin/auth/setAdmin', params);
  //删除管理员
  export const delAdmin = (params) => axios.post('delAdmin', params);

  //获取权限列表
  export const getPermissionsList = (params) => axios.get('admin/auth/permissionsList', {'params':{...params}});
  //获取我的权限列表
  export const getMyPermission = (params) => axios.get('admin/auth/getMyPermission', {'params':{...params}});
  //编辑权限
  export const permissionsSet = (params) => axios.get('admin/auth/permissionsSet', {'params':{...params}});
  //新增权限
  export const addPermissions = (params) => axios.post('admin/auth/setPermissions', params);
  //删除权限
  export const delPermissions = (params) => axios.post('admin/auth/delPermissions', params);

  //获取角色列表
  export const getRoleList = (params) => axios.get('admin/auth/roleList', {'params':{...params}});
  //编辑角色
  export const roleSet = (params) => axios.get('admin/auth/roleSet', {'params':{...params}});
  //添加角色
  export const setRole = (params) => axios.post('admin/auth/setRole', params);
  //删除角色
  export const delRole = (params) => axios.post('admin/auth/delRole', params);






























